<%-- 
    Document   : getuser
    Created on : 11-apr-2011, 20.58.53
    Author     : ste
--%>

<%--
%@ page import="java.sql.*" %>
--%>
<%@ page language="java" import="java.sql.*"%>
<%
        String emp_id = request.getParameter("emp_id").toString();
        String data = "";

        Connection conn = null;
//String url = "jdbc:mysql://localhost:3306/";
        String url = "jdbc:mysql://127.0.0.1/";

        String dbName = "protciv01";
        String driver = "com.mysql.jdbc.Driver";
        String userName = "ste";
        String password = "ws";

        int sumcount = 0;
        Statement st;
        try {
            Class.forName(driver).newInstance();

            conn = DriverManager.getConnection(url + dbName, userName, password);
            String query = "select * from anagrafica where id='" + emp_id + "'";

            st = conn.createStatement();
            ResultSet rs = st.executeQuery(query);
            while (rs.next()) {
                data = ":" + rs.getString(2) + ":" + rs.getString(3) + ":" + emp_id;
            }

            out.println(data);
        } catch (Exception e) {
            e.printStackTrace();
        }
%>
